package com.dlwx.parttimetalent.views;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.dlwx.parttimetalent.R;
import com.dlwx.parttimetalent.inter.DialogFilerInter;
import com.dlwx.parttimetalent.utils.ToastUtils;
import com.flyco.dialog.widget.base.BottomBaseDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/1/6.
 */

public class PayPswDialog extends BottomBaseDialog {
    @BindView(R.id.et_psw)
    EditText etPsw;
    @BindView(R.id.tv_confirm)
    TextView tvConfirm;
    @BindView(R.id.tv_cancel)
    TextView tvCancel;
    private Context context;
    private DialogFilerInter inter;

    public PayPswDialog(Context context,DialogFilerInter inter) {
        super(context);
        this.context = context;
        this.inter=inter;
    }

    @Override
    public View onCreateView() {
        View view = LayoutInflater.from(context).inflate(R.layout.dialog_pay_psw, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void setUiBeforShow() {

    }

    @OnClick({R.id.tv_confirm, R.id.tv_cancel})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_confirm:
                String psw=etPsw.getText().toString();
                if(TextUtils.isEmpty(psw)){
                    ToastUtils.toastForShort(context,"密码不能为空");
                    return;
                }
                inter.callBack(psw,"","","","","","");
                this.dismiss();
                break;
            case R.id.tv_cancel:
                this.dismiss();
                break;
        }
    }
}
